package com.xszx.config;

import com.xszx.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

//@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    //@Autowired
    //private LoginInterceptor loginInterceptor;

    /**
     * 拦截器配置
     */
    //@Override
    //public void addInterceptors(InterceptorRegistry registry) {
     //   System.out.println("开始注册自定义拦截器...");
      //  registry.addInterceptor(loginInterceptor);
//                .addPathPatterns("/**")
//                .excludePathPatterns("/login.jsp", //登录页面
//                        "/login",       //登录请求
//                        "/**/*.html",   //html静态资源
//                        "/**/*.js",     //js静态资源
//                        "/**/*.css"     //css静态资源
//                );
    }


//    /**
//     * 设置静态资源映射
//     * @param registry
//     */
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/**.html").addResourceLocations("classpath:/META-INF/resource/");
//        registry.addResourceHandler("/**.css").addResourceLocations("classpath:/META-INF/resource/");
//        registry.addResourceHandler("/**.js").addResourceLocations("classpath:/META-INF/resource/");
//    }
